GtkBuilderScope *scope;
GtkBuilder *builder;
GtkColumnViewColumn *name_column;
+ GtkColumnViewColumn *type_column;
+ GtkColumnViewColumn *default_column;
GtkSorter *sorter;
+ GActionGroup *actions;
+ GAction *action;
g_type_ensure (SETTINGS_TYPE_KEY);
listview = GTK_WIDGET (gtk_builder_get_object (builder, "listview"));
columnview = GTK_WIDGET (gtk_builder_get_object (builder, "columnview"));
+ type_column = GTK_COLUMN_VIEW_COLUMN (gtk_builder_get_object (builder, "type_column"));
+ default_column = GTK_COLUMN_VIEW_COLUMN (gtk_builder_get_object (builder, "default_column"));
+
+ actions = G_ACTION_GROUP (g_simple_action_group_new ());
+
+ action = G_ACTION (g_property_action_new ("show-type", type_column, "visible"));
+ g_action_map_add_action (G_ACTION_MAP (actions), action);
+ g_object_unref (action);
+
+ action = G_ACTION (g_property_action_new ("show-default", default_column, "visible"));
+ g_action_map_add_action (G_ACTION_MAP (actions), action);
+ g_object_unref (action);
+
+ gtk_widget_insert_action_group (columnview, "columnview", actions);
+ g_object_unref (actions);
+
model = create_settings_model (NULL, NULL);
treemodel = gtk_tree_list_model_new (FALSE,
model,
<child>
<object class="GtkColumnViewColumn" id="name_column">
<property name="title">Name</property>
+ <property name="header-menu">header_menu</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
<child>
<object class="GtkColumnViewColumn">
<property name="title">Value</property>
+ <property name="header-menu">header_menu</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
</object>
</child>
<child>
- <object class="GtkColumnViewColumn">
+ <object class="GtkColumnViewColumn" id="type_column">
<property name="title">Type</property>
+ <property name="header-menu">header_menu</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
</object>
</child>
<child>
- <object class="GtkColumnViewColumn">
+ <object class="GtkColumnViewColumn" id="default_column">
<property name="title">Default</property>
+ <property name="header-menu">header_menu</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
</object>
</child>
</object>
+ <menu id="header_menu">
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">Type</attribute>
+ <attribute name="action">columnview.show-type</attribute>
+ </item>
+ <item>
+ <attribute name="label" translatable="yes">Default value</attribute>
+ <attribute name="action">columnview.show-default</attribute>
+ </item>
+ </section>
+ </menu>
</interface>